const http = require('http')
const server = http.createServer()
server.on('request', (req, res) => {
  console.log('有人访问服务器了');
  const str = `你请求的URL是${req.url},你请求的方式是${req.method}`
  res.setHeader('Content-Type', 'text/html;charset=utf-8')
  res.end(str)
})
server.listen(8089, () => {
  console.log('服务器已经启动,请访问8089端口');
})